package com.zzh.weixinsell.service.impl;

import com.zzh.weixinsell.dao.ProductCategoryMapper;
import com.zzh.weixinsell.model.pojo.ProductCategory;
import com.zzh.weixinsell.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 类目
 * Create by ${ZZH} on 2018/4/18
 */

@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private ProductCategoryMapper productCategoryMapper;

    @Override
    public ProductCategory findOne(Integer categoryId) {
        return productCategoryMapper.findOne(categoryId);
    }

    @Override
    public List<ProductCategory> findAll() {
        return productCategoryMapper.findAll();
    }

    @Override
    public List<ProductCategory> findByCategoryTypeIn(List<Integer> categoryTypeList) {
        return productCategoryMapper.findByCategoryType(categoryTypeList);
    }

    @Override
    public int insertOne(Integer category_id, String category_name, Integer category_type) {
        return productCategoryMapper.insertOne(category_id,category_name,category_type);
    }
}
